<template>
    <L7Map map-id="my-map" @loaded="handleLoaded" :options="options"></L7Map>
</template>

<script setup lang="ts">
import { Scene, LineLayer } from '@antv/l7'

const options: any = ref({
    projection: '',
    center: [60, 40.7128],
    zoom: 2,

})
const handleLoaded = async (scene: Scene) => {
    const data = await fetch('/txt/wind.txt').then(res => res.text())
    const layer = new LineLayer({ blend: 'normal' })
        .source(data, {
            parser: {
                type: 'csv',
                x: 'lng1',
                y: 'lat1',
                x1: 'lng2',
                y1: 'lat2',
            },
        })
        .size(1)
        .shape('arc')
        .color('#6495ED')
        .animate({
            enable: false,
            duration: 4,
            interval: 0.25,
            trailLength: 0.6,
        });
    // .forward(false)
    scene.addLayer(layer);
}
</script>
